package com.service.business.coupon.controller;

import com.service.business.coupon.controller.rep.MemberCouponPageRep;
import com.service.business.coupon.controller.req.MemberCouponPageReq;
import com.service.business.framework.log.RequestLog;
import com.service.business.product.service.MemberCouponService;
import com.service.business.support.SessionUtil;
import com.service.core.rest.BaseController;
import com.service.core.rest.response.PageResponse;
import com.service.dao.model.MemberCoupon;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping("/coupon")
@Api(tags = "优惠券")
public class CouponController extends BaseController {

    @Autowired
    private MemberCouponService memberCouponService;


    @RequestLog("优惠券分页查询")
    @GetMapping("page")
    public PageResponse<MemberCoupon> pageCouponList(@ApiParam @RequestBody MemberCouponPageReq req){
        return successQueryPageResponse(memberCouponService.pageMemberCouponById(req));
    }
}
